Skip to content

Measure ASCII glyph widths when the width table is unavailable - #1182

Open
sogav21 wants to merge 1 commit into
ecomfe:masterfrom
sogav21:fix/echarts-21812-font-width-fallback
Open

sogav21 wants to merge 1 commit into
ecomfe:masterfrom
sogav21:fix/echarts-21812-font-width-fallback

Conversation

@sogav21

@sogav21 sogav21 commented Nov 4, 2026

Copy link
Copy Markdown

When building an ASCII width table is too slow, later fonts skip table construction. The fallback used the width of a for every ASCII glyph, which produced incorrect line breaks for proportional fonts. Use the existing measurement cache to measure each character on demand.

A regression test forces the slow-table path, checks wrapping for narrow and wide characters, and verifies repeat calls reuse measured widths. All 69 Jest tests, type checking, library build, and lint passed.

Refs apache/echarts#21812.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant